package dk.dashboardFP.panels.settingspanel.info {
	import dk.dashboardFP.DashboardFP;
	import dk.dashboardFP.core.DashboardFPCore;
	import dk.dashboardFP.elements.button.SmallButtonElement;
	import dk.dashboardFP.interactionElementFramwork.buttons.ButtonEvent;
	import dk.dashboardFP.panels.fontPreview.FontPreviewPanel;

	/**
	 * @author josef
	 */
	public class FontInfo extends InfoLine {
		private var _previewFontsButton : SmallButtonElement;

		public function FontInfo() {
			super();
			
			setLabel("Embedded fonts");
			
			_previewFontsButton = new SmallButtonElement("previewFonts", "Preview");
			addChild(_previewFontsButton);
			
			_previewFontsButton.x = _label.width + 3;
			_previewFontsButton.y = -7;
			
			_previewFontsButton.oButton.addEventListener(ButtonEvent.CLICKED, onPreviewRequest);
		}

		private function onPreviewRequest(event : ButtonEvent) : void {
			(DashboardFP.getInstance().dashbardFPCore as DashboardFPCore).addTempPanel(new FontPreviewPanel(DashboardFP.getInstance().dashbardFPCore as DashboardFPCore));
		}
	}
}
